package com.atguigu.gulimall.order.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author : wenchao.long
 * @date : Created in 2021/8/18 19:52 周三
 * @description :
 */
@Data
public class OrderItemVO {

    @ApiModelProperty("商品id")
    private Long skuId;

    @ApiModelProperty("商品标题")
    private String title;

    @ApiModelProperty("商品图片")
    private String image;

    @ApiModelProperty("商品套餐信息")
    private List<String> skuAttr;

    @ApiModelProperty("商品价格")
    private BigDecimal price;

    @ApiModelProperty("商品数量")
    private Integer count;

    @ApiModelProperty("商品总价格")
    private BigDecimal totalPrice;

    private BigDecimal weight;

    public BigDecimal getTotalPrice() {
        return this.price.multiply(new BigDecimal(this.getCount()));
    }

}
